home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 335_01 / as6502.txt < prev    next >
Text File  |  1990-12-02  |  17KB  |  727 lines

  1.  
  2.  
  3.  
  4.                                   - 1 -
  5.  
  6.  
  7.  
  8.        A.  Appendix_for_as6502_Frankenstein_Assembler
  9.  
  10.        A.1  Pseudo_Operations
  11.  
  12.        A.1.1  Standard_Pseudo_Operation_Mnemonics
  13.  
  14.             End                                END
  15.             File Inclusion                     INCL INCLUDE
  16.             If                                 IF
  17.             Else                               ELSE
  18.             End If                             ENDI
  19.             Equate                             EQU
  20.             Set                                SET
  21.             Org                                ORG
  22.             Reserve Memory                     RESERVE RMB
  23.             Define Byte Data                   BYTE DB FCB
  24.             Define Word Data                   DW FDB WORD
  25.             Define String Data                 FCC STRING
  26.             Define Character Set Translation   CHARSET
  27.             Define Character Value             CHARDEF CHD
  28.             Use Character Translation          CHARUSE
  29.  
  30.        A.1.2  Machine_Dependent_Pseudo_Operations
  31.  
  32.        A.1.2.1  Define_Word_Data  The define word pseudo-operations
  33.        generates the byte reversed (low byte, high byte)
  34.        representation.
  35.  
  36.        A.1.2.2  Instruction_Set_Selection
  37.  
  38.             CPU string
  39.  
  40.        The instruction set can be specified in the source file with
  41.        the CPU pseudooperation.  The string, delimited by quotes or
  42.        apostrophes, is scanned for a substring which selects which
  43.        instruction set is used.  When the program is invoked, this
  44.        operation is performed on the name of the program, then the
  45.        -p optional arguement, if any, and then any CPU statements.
  46.        The last one selects which subset of the instructions the
  47.        assembler will accept.  The instruction set can be changed
  48.        at any place in the source file.
  49.  
  50.  
  51.             Instruction Set          Substrings
  52.             ROCKWELL CMOS            R65C r65c
  53.             CMOS                     65C 65c
  54.             ROCKWELL Extended        R65 r65
  55.             R65C00/21                21
  56.             Standard NMOS            65
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                                   - 2 -
  71.  
  72.  
  73.  
  74.        A.2  Instructions
  75.  
  76.        A.2.1  Instruction_List
  77.  
  78.        Opcode   Syntax                       Selection Criteria
  79.  
  80.  
  81.        ADC       '#' topexpr
  82.        ADC       '(' topexpr ')' ',' INDEX   DIRECT INDEXY
  83.        ADC       '(' topexpr ')'             DIRECT INSTCMOS
  84.        ADC       '(' topexpr ',' INDEX ')'   DIRECT INDEXX
  85.        ADC       topexpr ',' INDEX           DIRECT INDEXX
  86.        ADC       topexpr ',' INDEX           EXTENDED INDEXX
  87.        ADC       topexpr ',' INDEX           INDEXY
  88.        ADC       topexpr                     DIRECT
  89.        ADC       topexpr                     EXTENDED
  90.  
  91.        AND       '#' topexpr
  92.        AND       '(' topexpr ')' ',' INDEX   DIRECT INDEXY
  93.        AND       '(' topexpr ')'             DIRECT INSTCMOS
  94.        AND       '(' topexpr ',' INDEX ')'   DIRECT INDEXX
  95.        AND       topexpr ',' INDEX           DIRECT INDEXX
  96.        AND       topexpr ',' INDEX           EXTENDED INDEXX
  97.        AND       topexpr ',' INDEX           INDEXY
  98.        AND       topexpr                     DIRECT
  99.        AND       topexpr                     EXTENDED
  100.  
  101.        ASL       ACCUM
  102.        ASL       topexpr ',' INDEX           DIRECT INDEXX
  103.        ASL       topexpr ',' INDEX           EXTENDED INDEXX
  104.        ASL       topexpr                     DIRECT
  105.        ASL       topexpr                     EXTENDED
  106.  
  107.        BBR0      topexpr ',' topexpr         INSTROCKWELL
  108.  
  109.        BBR1      topexpr ',' topexpr         INSTROCKWELL
  110.  
  111.        BBR2      topexpr ',' topexpr         INSTROCKWELL
  112.  
  113.        BBR3      topexpr ',' topexpr         INSTROCKWELL
  114.  
  115.        BBR4      topexpr ',' topexpr         INSTROCKWELL
  116.  
  117.        BBR5      topexpr ',' topexpr         INSTROCKWELL
  118.  
  119.        BBR6      topexpr ',' topexpr         INSTROCKWELL
  120.  
  121.        BBR7      topexpr ',' topexpr         INSTROCKWELL
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                                   - 3 -
  137.  
  138.  
  139.  
  140.        Opcode   Syntax                       Selection Criteria
  141.  
  142.        BBS0      topexpr ',' topexpr         INSTROCKWELL
  143.  
  144.        BBS1      topexpr ',' topexpr         INSTROCKWELL
  145.  
  146.        BBS2      topexpr ',' topexpr         INSTROCKWELL
  147.  
  148.        BBS3      topexpr ',' topexpr         INSTROCKWELL
  149.  
  150.        BBS4      topexpr ',' topexpr         INSTROCKWELL
  151.  
  152.        BBS5      topexpr ',' topexpr         INSTROCKWELL
  153.  
  154.        BBS6      topexpr ',' topexpr         INSTROCKWELL
  155.  
  156.        BBS7      topexpr ',' topexpr         INSTROCKWELL
  157.  
  158.        BCC       topexpr
  159.  
  160.        BCS       topexpr
  161.  
  162.        BEQ       topexpr
  163.  
  164.        BGE       topexpr
  165.  
  166.        BIT       '#' topexpr                 INSTCMOS
  167.        BIT       topexpr ',' INDEX           DIRECT INDEXX INSTCMOS
  168.        BIT       topexpr ',' INDEX           EXTENDED INDEXX INSTCMOS
  169.        BIT       topexpr                     DIRECT
  170.        BIT       topexpr                     EXTENDED
  171.  
  172.        BLT       topexpr
  173.  
  174.        BMI       topexpr
  175.  
  176.        BNE       topexpr
  177.  
  178.        BPL       topexpr
  179.  
  180.        BRA       topexpr                     INST21
  181.        BRA       topexpr                     INSTCMOS
  182.  
  183.        BRK       '#' topexpr
  184.        BRK
  185.  
  186.        BVC       topexpr
  187.  
  188.        BVS       topexpr
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                                   - 4 -
  203.  
  204.  
  205.  
  206.        Opcode   Syntax                       Selection Criteria
  207.  
  208.  
  209.        CLC
  210.  
  211.        CLD
  212.  
  213.        CLI
  214.  
  215.        CLV
  216.  
  217.        CMP       '#' topexpr
  218.        CMP       '(' topexpr ')' ',' INDEX   DIRECT INDEXY
  219.        CMP       '(' topexpr ')'             DIRECT INSTCMOS
  220.        CMP       '(' topexpr ',' INDEX ')'   DIRECT INDEXX
  221.        CMP       topexpr ',' INDEX           DIRECT INDEXX
  222.        CMP       topexpr ',' INDEX           EXTENDED INDEXX
  223.        CMP       topexpr ',' INDEX           INDEXY
  224.        CMP       topexpr                     DIRECT
  225.        CMP       topexpr                     EXTENDED
  226.  
  227.        CPX       '#' topexpr
  228.        CPX       topexpr                     DIRECT
  229.        CPX       topexpr                     EXTENDED
  230.  
  231.        CPY       '#' topexpr
  232.        CPY       topexpr                     DIRECT
  233.        CPY       topexpr                     EXTENDED
  234.  
  235.        DEC       ACCUM                       INSTCMOS
  236.        DEC       topexpr ',' INDEX           DIRECT INDEXX
  237.        DEC       topexpr ',' INDEX           EXTENDED INDEXX
  238.        DEC       topexpr                     DIRECT
  239.        DEC       topexpr                     EXTENDED
  240.  
  241.        DEX
  242.  
  243.        DEY
  244.  
  245.        EOR       '#' topexpr
  246.        EOR       '(' topexpr ')' ',' INDEX   DIRECT INDEXY
  247.        EOR       '(' topexpr ')'             DIRECT INSTCMOS
  248.        EOR       '(' topexpr ',' INDEX ')'   DIRECT INDEXX
  249.        EOR       topexpr ',' INDEX           DIRECT INDEXX
  250.        EOR       topexpr ',' INDEX           EXTENDED INDEXX
  251.        EOR       topexpr ',' INDEX           INDEXY
  252.        EOR       topexpr                     DIRECT
  253.        EOR       topexpr                     EXTENDED
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.                                   - 5 -
  269.  
  270.  
  271.  
  272.        Opcode   Syntax                       Selection Criteria
  273.  
  274.        INC       ACCUM                       INSTCMOS
  275.        INC       topexpr ',' INDEX           DIRECT INDEXX
  276.        INC       topexpr ',' INDEX           EXTENDED INDEXX
  277.        INC       topexpr                     DIRECT
  278.        INC       topexpr                     EXTENDED
  279.  
  280.        INX
  281.  
  282.        INY
  283.  
  284.        JMP       '(' topexpr ')'
  285.        JMP       '(' topexpr ',' INDEX ')'   INSTCMOS INDEXX
  286.        JMP       topexpr
  287.  
  288.        JSR       topexpr
  289.  
  290.        LDA       '#' topexpr
  291.        LDA       '(' topexpr ')' ',' INDEX   DIRECT INDEXY
  292.        LDA       '(' topexpr ')'             DIRECT INSTCMOS
  293.        LDA       '(' topexpr ',' INDEX ')'   DIRECT INDEXX
  294.        LDA       topexpr ',' INDEX           DIRECT INDEXX
  295.        LDA       topexpr ',' INDEX           EXT